<template>
  <el-col :span="1.5">
    <el-button
      type="info"
      plain
      icon="Search"
      @click="toggleSearch"
    >
      {{ showSearch ? '隐藏' : '显示' }}搜索
    </el-button>
  </el-col>
</template>

<script setup lang="ts">
//import { defineProps, defineEmits } from 'vue'    // 111 vue3.2开始 有 setup 就不再需要引入这个

const props = defineProps<{
  showSearch: boolean
}>()

const emit = defineEmits<{
  'update:showSearch': [value: boolean]
  'queryTable': []
}>()

const toggleSearch = () => {
  emit('update:showSearch', !props.showSearch)
  emit('queryTable')
}
</script>

<style scoped>
</style>
